<div class="yiiForm">

<?php
if(Yii::app()->user->hasFlash('model')) {
	Yii::app()->user->flash('model', array('<div class="confirmation">', '</div>'));
	echo "</div>";
	return;
}
?>

	<?php echo Html::beginForm(); ?>

	<?php echo Html::errorSummary($model); ?>

	<div class="simple">
		<?php echo Html::activeLabel($model,'backgroundcolor'); ?>
		<?php echo Html::activeTextField($model,'backgroundcolor',array('class'=>'color')); ?>
	</div>

	<div class="simple">
		<?php echo Html::activeLabel($model,'backgroundimage'); ?>
		<?php echo Html::activeTextField($model,'backgroundimage'); ?>
	</div>

	<div class="simple">
		<?php echo Html::activeLabel($model,'backgroundrepeat'); ?>
		<?php echo Html::activeDropDownList($model,'backgroundrepeat',
		array(
		'repeat'=>'repeat',
		'repeat-x'=>'repeat-x',
		'repeat-y'=>'repeat-y',
		'no-repeat'=>'no-repeat',
		)); ?>
	</div>

	<div class="simple">
		<?php echo Html::activeLabel($model,'fontfamily'); ?>
		<?php echo Html::activeDropDownList($model,'fontfamily',
		array(
		'Arial'=>'Arial',
		'Georgia'=>'Georgia',
		'Times New Roman'=>'Times New Roman',
		'Helvetica'=>'Helvetica',
		)); ?>
	</div>

	<div class="simple">
		<?php echo Html::activeLabel($model,'fontsize'); ?>
		<?php echo Html::activeDropDownList($model,'fontsize',
		array(
		'70%'=>'70%',
		'80%'=>'80%',
		'90%'=>'90%',
		'100%'=>'100%',
		'110%'=>'110%',
		'120%'=>'120%',
		'130%'=>'130%',
		'150%'=>'150%',
		'200%'=>'200%',
		)); ?>
	</div>

	<div class="simple">
		<?php echo Html::activeLabel($model,'linkcolor'); ?>
		<?php echo Html::activeTextField($model,'linkcolor',array('class'=>'color')); ?>
	</div>

	<div class="simple">
		<?php echo Html::activeLabel($model,'linkcolorhover'); ?>
		<?php echo Html::activeTextField($model,'linkcolorhover',array('class'=>'color')); ?>
	</div>

	<div class="simple">
		<?php echo Html::activeLabel($model,'contentbgcolor'); ?>
		<?php echo Html::activeTextField($model,'contentbgcolor',array('class'=>'color')); ?>
	</div>

	<div class="simple">
		<?php echo Html::activeLabel($model,'footerbgcolor'); ?>
		<?php echo Html::activeTextField($model,'footerbgcolor',array('class'=>'color')); ?>
	</div>

	<div class="action">
		<?php echo Html::submitButton(Yii::t('yii','Save'),array('class'=>'submit')); ?>
	</div>

<?php echo Html::endForm(); ?>

</div><!-- form -->

<?php 
$script= <<<EOD
$('.color').ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {
		$(el).val(hex);
		$(el).ColorPickerHide();
	},
	onBeforeShow: function () {
		$(this).ColorPickerSetColor(this.value);
	}
})
.bind('keyup', function(){
	$(this).ColorPickerSetColor(this.value);
});

EOD;

echo "<script type=\"text/javascript\">$.getScript(\"".Html::jsUrl('colorpicker.js')."\", function(){".$script."});</script>\n";
?>

